package com.yqg.protection.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yqg.protection.cover.LocalDateTimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * record_check 实体类
 *
 * @author 小宇
 * @since 2024-09-13
 */
@Getter
@Setter
@TableName("record_check")
@ApiModel(value = "RecordCheck对象", description = "查岗记录")
public class RecordCheck implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "ID", index = 0)
    @ApiModelProperty("自增ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "查岗人ID", index = 1)
    private Long userId;

    @ExcelProperty(value = "查岗人名称", index = 2)
    @ApiModelProperty("查岗人名称")
    @TableField(exist = false)
    private String userName;

    @ExcelProperty(value = "发起时间", index = 3, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty("发起时间")
    private LocalDateTime startTime;

    @ExcelProperty(value = "结束时间", index = 4, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    @ApiModelProperty("结束时间")
    private LocalDateTime endTime;

    @ExcelProperty(value = "设备IP", index = 5)
    @ApiModelProperty("设备IP")
    private String ip;

    @ExcelProperty(value = "查岗状态", index = 6)
    @ApiModelProperty("查岗状态")
    private String state;

    @ExcelProperty(value = "查岗结果", index = 7)
    @ApiModelProperty("查岗结果")
    private String result;

    @ExcelIgnore
    private Integer isDelete;

}
